<template>
  <div class="dialog-warp layui-anim-scale" v-if="isShow">
    <div class="mask layui-anim-scale" @click="close"></div>
    <div class="content layui-anim-scale" :style="{ width: width, height: height }">
      <slot name="dialog"></slot>
    </div>
  </div>
</template>

<script>
export default {
  name: 'dialog-mask',
  props: ['height', 'width', 'isShow'],
  methods: {
    close () {
      this.$emit('close')
    }
  }
}
</script>

<style lang="scss" scoped>
.dialog-warp {
  width: 100%;
  height: 100%;
  position: fixed;
  top: 0px;
  left: 0px;
  z-index: 10;
  .mask {
    position: fixed;
    top: 0px;
    left: 0px;
    background-color: rgba(0, 0, 0, 0.3);
    width: 100%;
    height: 100%;
  }
  .content {
    background-color: #fff;
    border-radius: 2px;
    box-shadow: 1px 1px 50px rgb(0 0 0 / 30%);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
  }
}
</style>
